#define _CRT_SECURE_NO_WARNINGS

//二分查找

class Solution {
public:
    int guessNumber(int n) {
        int left = 1;
        int right = n;
        while(left<right)
        {
            int mid = left + (right-left)/2;
            if(guess(mid) <= 0)
                right = mid;
            else
                left = mid+1;
        }
        return left;
    }
};












